
var MenuLayer = cc.Layer.extend({
  ctor: function(){
    this._super();
  },
  init: function(){
    this._super();

    var centerpos = cc.p(winSize.width / 2, winSize.height / 2);

    var spritebg = cc.Sprite.create(s_HelloBG);
    spritebg.setPosition(centerpos);
    this.addChild(spritebg);

    cc.MenuItemFont.setFontSize(60);

    var menuItemPlay = cc.MenuItemSprite.create(
      cc.Sprite.create(s_start_n),
      cc.Sprite.create(s_start_s),
      this.onPlay,
      this
    );
    var menu = cc.Menu.create(menuItemPlay);
    menu.setPosition(centerpos);
    this.addChild(menu);
  },
  onPlay: function(){
    cc.log('onplay clicked');
    director.replaceScene(new PlayScene());
  }
});

var MenuScene = cc.Scene.extend({
  onEnter: function(){
    this._super();
    var layer = new MenuLayer();
    layer.init();
    this.addChild(layer);
  }
});

